PARAM_FILE:=./Makefile.param
include $(PARAM_FILE)

CC = $(CROSS_COMPILE)gcc
RANLIB = $(CROSS_COMPILE)ranlib
AR = $(CROSS_COMPILE)ar

OUT_DIR := ./obj/$(PROJ)/
CFLAGS := -g -O2 -D_REENTRANT -Wall -I$(OUT_DIR)
LIBS := -lpthread -lmylib -L$(OUT_DIR) 
OBJ_NAME := mytest
SOURCE := $(wildcard *.c)
OBJS := $(patsubst %.c,%.o,$(SOURCE))
CLEANFILES := *.o *.so *.a

%.o:%.c mylib.h
	$(CC) -c -o $@ $< $(CFLAGS)


.PHONY:all
all: $(OBJ_NAME)

$(OBJ_NAME):$(OBJS)
	$(CC) -o $@ $^ $(LIBS) $(CFLAGS)
	cp $(OBJ_NAME) /root/dev_home/hi3531/nvr/Hi3531_SDK_V1.0.8.0/mpp/sample/hi3531/mytest
clean:
	rm -f $(CLEANFILES)

